package com.hshh.interceptor;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.ui.ModelMap;
import org.springframework.web.context.request.WebRequest;
import org.springframework.web.servlet.handler.HandlerInterceptorAdapter;

public class BaseInterceptor extends HandlerInterceptorAdapter {
	protected Log log = LogFactory.getLog(this.getClass());
	public boolean preHandle(HttpServletRequest request, 
			HttpServletResponse response, Object handler) throws Exception {
		System.out.println("BaseInterceptor!");
		return true;
	}
	public void afterCompletion(WebRequest arg0, Exception arg1)
			throws Exception {
		// TODO Auto-generated method stub
		System.out.println("BaseInterceptor : afterCompletion");
	}
	public void postHandle(WebRequest arg0, ModelMap arg1) throws Exception {
		// TODO Auto-generated method stub
		System.out.println("BaseInterceptor : postHandle");
	}
	public void preHandle(WebRequest arg0) throws Exception {
		// TODO Auto-generated method stub
		System.out.println("BaseInterceptor : preHandle");
		System.out.println(arg0.getContextPath());
	}
	public boolean preHandle(HttpServletRequest request,
			HttpServletResponse response) throws Exception {
		// TODO Auto-generated method stub
		return false;
	}
}
